<script lang="ts" setup>
import { useRouter } from 'vue-router'
import { toRefs } from "vue";
import { ShareListType } from "@/typing";
import { homeStoriesStore } from "../../store";


const router = useRouter()

const store = homeStoriesStore();
const { updateShareList } = store;

const props = defineProps<{
    shareList: ShareListType,
    type: number
}>()
const { shareList,type } = toRefs(props)

function goToShareView() {
    updateShareList(shareList.value)
    router.push({ name: 'share' });
}
</script>

<template>
    <img v-if="(type == 0)" class="w-10 h-10 " src="../../assets/card/feeds_share.png" alt="share"
        @click="goToShareView">
    <img v-if="(type == 1)" class="w-8 h-8" src="@/assets/share/share_image.png" alt="share" @click="goToShareView">
</template>